ref: remove client side data truncation#1903
Merged
Merged
Conversation
Litarnus
commented
Sep 15, 2025
Comment on lines
-399
to
-414
| public function testLongString(bool $serializeAllObjects): void | ||
| { | ||
| $serializer = $this->createSerializer(); | ||
|
|
||
| if ($serializeAllObjects) { | ||
| $serializer->setSerializeAllObjects(true); | ||
| } | ||
|
|
||
| foreach ([100, 1000, 1010, 1024, 1050, 1100, 10000] as $length) { | ||
| $input = str_repeat('x', $length); | ||
| $result = $this->invokeSerialization($serializer, $input); | ||
|
|
||
| $this->assertIsString($result); | ||
| $this->assertLessThanOrEqual(1024, \strlen($result)); | ||
| } | ||
| } |
Contributor
Author
There was a problem hiding this comment.
We could also change this to $this->assertLessThanOrEqual($length, \strlen($result)); which is admittedly a bit goofy but it would test that truncation is not applied.
Collaborator
There was a problem hiding this comment.
Agreed this would be a bit goofy. Don't think we need to test this specifically.
stayallive
approved these changes
Sep 17, 2025
Comment on lines
-399
to
-414
| public function testLongString(bool $serializeAllObjects): void | ||
| { | ||
| $serializer = $this->createSerializer(); | ||
|
|
||
| if ($serializeAllObjects) { | ||
| $serializer->setSerializeAllObjects(true); | ||
| } | ||
|
|
||
| foreach ([100, 1000, 1010, 1024, 1050, 1100, 10000] as $length) { | ||
| $input = str_repeat('x', $length); | ||
| $result = $this->invokeSerialization($serializer, $input); | ||
|
|
||
| $this->assertIsString($result); | ||
| $this->assertLessThanOrEqual(1024, \strlen($result)); | ||
| } | ||
| } |
Collaborator
There was a problem hiding this comment.
Agreed this would be a bit goofy. Don't think we need to test this specifically.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
It looks like this is the only place we perform SDK-side data truncation that isn't related to recursion depth or other limits mentioned in #1814.
closes PHP-1